package model;

public class Paper {
    private final String title;
    
    public Paper(String title) {
        if (title == null || title.length() < 3) {
            throw new IllegalArgumentException("论文标题长度至少3个字符");
        }
        this.title = title;
    }
    
    public String getTitle() {
        return title;
    }
    
    public String toString() {
        return title + " (" + this.getClass().getSimpleName() + ")";
    }
    
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Paper paper = (Paper) o;
        return title.equals(paper.title);
    }
    
    @Override
    public int hashCode() {
        return title.hashCode();
    }
}
